﻿using FirstFloor.ModernUI.Presentation;
using ModernUILogViewer.Model;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Windows.Media;

namespace ModernUILogViewer.Settings
{
    sealed class AppSettings : ApplicationSettingsBase
    {
        #region Window

        [UserScopedSettingAttribute()]
        [DefaultSettingValue("800")]
        public int Width
        {
            get { return (int)(this["Width"]); }
            set { this["Width"] = value; }
        }

        [UserScopedSettingAttribute()]
        [DefaultSettingValue("640")]
        public int Height
        {
            get { return (int)(this["Height"]); }
            set { this["Height"] = value; }
        }

        [UserScopedSettingAttribute()]
        [DefaultSettingValue("100")]
        public int Top
        {
            get { return (int)(this["Top"]); }
            set { this["Top"] = value; }
        }

        [UserScopedSettingAttribute()]
        [DefaultSettingValue("200")]
        public int Left
        {
            get { return (int)(this["Left"]); }
            set { this["Left"] = value; }
        }

        [UserScopedSettingAttribute()]
        [DefaultSettingValue("True")]
        public bool StartWithWelcomePage
        {
            get { return (bool)(this["StartWithWelcomePage"]); }
            set { this["StartWithWelcomePage"] = value; }
        }

        #endregion

        #region HomeViewModel

        [UserScopedSettingAttribute()]
        [DefaultSettingValue("false")]
        public bool MatchWholeWord
        {
            get { return (bool)(this["MatchWholeWord"]); }
            set { this["MatchWholeWord"] = value; }
        }


        [UserScopedSettingAttribute()]
        [DefaultSettingValue("true")]
        public bool MatchIgnoreCase
        {
            get { return (bool)(this["MatchIgnoreCase"]); }
            set { this["MatchIgnoreCase"] = value; }
        }

        #endregion

        #region SettingsAppearanceViewModel

        [UserScopedSettingAttribute()]        
        public Color SelectedAccentColor
        {
            get {
                if (this["SelectedAccentColor"] == null)
                    return AppearanceManager.Current.AccentColor;                        
                return (Color)(this["SelectedAccentColor"]); }
            set { this["SelectedAccentColor"] = value; }
        }

        [UserScopedSettingAttribute()]  
        [DefaultSettingValue("1")]
        public int SelectedThemeIndex
        {
            get { return (int)(this["SelectedThemeIndex"]); }
            set { this["SelectedThemeIndex"] = value; }
        }

        [UserScopedSettingAttribute()]
        [DefaultSettingValue("large")]
        public string SelectedFontSize
        {
            get { return (string)(this["SelectedFontSize"]); }
            set { this["SelectedFontSize"] = value; }
        }

        #endregion
    }
}
